<?php
include("include/conn.php");
require('include/Smarty/libs/Smarty.class.php');
require('amountToWords.php');

$voucherArray = array();

$selectVoucher = "SELECT aavakvoucherId,billNo,DATE_FORMAT(date,'%d-%m-%Y')AS date,drCr,partyName,silver,touch,weight,labour,amount
                    FROM aavakvoucher
                   WHERE aavakvoucherId = ".$_GET['aavakvoucherId']; 
$voucherRes = mysql_query($selectVoucher);
$a = 0;
while($voucherRow = mysql_fetch_assoc($voucherRes))
{
	$voucherArray[$a]['aavakvoucherId'] = $voucherRow['aavakvoucherId'];
	$voucherArray[$a]['billNo']         = $voucherRow['billNo'];
	$voucherArray[$a]['date']           = $voucherRow['date'];
	$voucherArray[$a]['drCr']           = $voucherRow['drCr'];
	$voucherArray[$a]['partyName']      = $voucherRow['partyName'];
	$voucherArray[$a]['silver']         = $voucherRow['silver'];
	$voucherArray[$a]['touch']          = $voucherRow['touch'];
	$voucherArray[$a]['weight']         = formatInIndianStyle($voucherRow['weight']);
	$voucherArray[$a]['labour']         = formatInIndianStyle($voucherRow['labour']);
	$voucherArray[$a]['amount']         = formatInIndianStyle($voucherRow['amount']);
	$a++;
}
$smarty = new Smarty;
require("bottom.php");

$smarty->assign("voucherArray",$voucherArray);
$smarty->display("voucherPrint.tpl");
?>